import Request from "./request";
const type = localStorage.getItem("type");
const marketId = localStorage.getItem("marketId");
const pfmarketId = localStorage.getItem("pfmarketId");

console.log(pfmarketId);

//获取市场简介接口
export function getIntro(weiyima) {
  return Request({
    url: "/chuMoPingGSP/getMarketByWeiyima",
    method: "post",
    data: {
      weiyima: weiyima,
    },
  });
}

//获取市场简介接口
export function getShiCJSByMarket() {
  return Request({
    url: "/chuMoPingGSP/getShiCJSByMarketId",
    method: "post",
    data: {
      type: "850",
      marketId: localStorage.getItem("marketId"),
    },
  });
}

//获取市场分布接口
export function getShiCFBByMarket() {
  return Request({
    url: "/chuMoPingGSP/getShiCJSByMarketId",
    method: "post",
    data: {
      type: "865",
      marketId: localStorage.getItem("marketId"),
    },
  });
}

//获取市场管理制度接口
export function getShiCGLZD() {
  return Request({
    url: "/chuMoPingGSP/getShiCJSGLZDXL",
    method: "post",
    data: {},
  });
}

// 获取管理制度每个小制度的内容接口：
export function getSmallShiCGLZD(ruleTypeId) {
  return Request({
    url: "/chuMoPingGSP/getShiCJSByMarketId",
    method: "post",
    data: {
      type: "854",
      marketId: localStorage.getItem("marketId"),
      ruleTypeId,
    },
  });
}

// 获取管理人员接口
export function getGLRY() {
  return Request({
    url: "/chuMoPingGSP/getGLRYXXByMarketId",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
    },
  });
}

//获取食品安全管理接口
export function getShiCSPGLByMarket() {
  return Request({
    url: "/chuMoPingGSP/getShiCJSByMarketId",
    method: "post",
    data: {
      type: "860",
      marketId: localStorage.getItem("marketId"),
    },
  });
}

//获取优秀摊位接口
export function getYXTWByMarket() {
  return Request({
    url: "/chuMoPingGSP/getBYTByMarketId",
    method: "post",
    data: {
      jylbnm: "全部",
      marketId: localStorage.getItem("marketId"),
    },
  });
}

//获取cxgs接口
export function getCXGSByMarket() {
  return Request({
    url: "/chuMoPingGSP/getChengXGSByMarketId",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
    },
  });
}
//获取cxgs详情接口
export function getCXGSDetailByMarket(xydj) {
  return Request({
    url: "/chuMoPingGSP/getChengXGSByMarketIdACount",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
      xydj: xydj,
    },
  });
}

//获取商户类别接口
export function getSHLB() {
  return Request({
    url: "/chuMoPingGSP/getJyhsjLBByMarketId",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
    },
  });
}
//根据经营类别获取商户信息接口
export function getSHXX(jylbnm) {
  return Request({
    url: "/chuMoPingGSP/getJyhsjByMarketId",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
      jylbnm: jylbnm,
    },
  });
}
//获取菜价管理信息接口
export function getCJGL() {
  return Request({
    url: "/chuMoPingGSP/getCankjgByMarketId",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
    },
  });
}
//获取交易查询接口
export function getJYCX() {
  return Request({
    url: "/chuMoPingGSP/getJYSJByMarketId",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
    },
  });
}
//获取科普知识查询接口
export function getKnowledge() {
  return Request({
    url: "/chuMoPingGSP/getShiCJSByMarketId",
    method: "post",
    data: {
      type: 858,
      marketId: localStorage.getItem("marketId"),
    },
  });
}

//获取检测公示批发市场的接口
export function getJCSC() {
  return Request({
    url: "/chuMoPingGSP/getJianceGSByMarketId",
    method: "post",
    data: {
      type: 858,
      marketId: localStorage.getItem("pfmarketId"),
    },
  });
}

//获取检测公示农贸市场的接口
export function getNMSC() {
  return Request({
    url: "/chuMoPingGSP/getJianceGSByMarketId",
    method: "post",
    data: {
      type: 858,
      marketId: localStorage.getItem("marketId"),
    },
  });
}

//获取统计信息接口
export function getTJXX() {
  return Request({
    url: "/chuMoPingGSP/getTongJiXXJYZKMarketId",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
    },
  });
}

//获取今日交易占比图
export function getJRJY() {
  return Request({
    url: "/chuMoPingGSP/getTongJiXXJYZBByMarketId",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
    },
  });
}

//获取项目检测图
export function getXMJC() {
  return Request({
    url: "/chuMoPingGSP/getTongJiXXJCXMByMarketId",
    method: "post",
    data: {
      marketId: localStorage.getItem("marketId"),
    },
  });
}
//获取溯源信息
export function getSUYUAN(shenfenma) {
  return Request({
    url: "/chuMoPingGSP/getJYSJByJYHJyLuLPiHao",
    method: "post",
    data: {
      shenfenma: shenfenma,
    },
  });
}

//验证唯一码是否正确
export function getYZWYM(weiyima) {
  return Request({
    url: "/chuMoPingGSP/yzMarketByWeiyima",
    method: "post",
    data:{
      weiyima
    }
  });
}
